home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / pc / DirectX SDK / DXSDK / samples / Multimedia / DirectShow / Capture / PlayCap / playcap.h < prev    next >
Encoding:
Text File  |  2001-10-08  |  1.6 KB  |  58 lines

  1. //------------------------------------------------------------------------------
  2. // File: PlayCap.h
  3. //
  4. // Desc: DirectShow sample code - header file for PlayCap previewer
  5. //       application.
  6. //
  7. // Copyright (c) 1998-2001 Microsoft Corporation.  All rights reserved.
  8. //------------------------------------------------------------------------------
  9.  
  10.  
  11. //
  12. // Function prototypes
  13. //
  14. int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hInstP, LPSTR lpCmdLine, int nCmdShow);
  15. LRESULT CALLBACK WndMainProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
  16.  
  17. HRESULT GetInterfaces(void);
  18. HRESULT CaptureVideo();
  19. HRESULT FindCaptureDevice(IBaseFilter ** ppSrcFilter);
  20. HRESULT SetupVideoWindow(void);
  21. HRESULT ChangePreviewState(int nShow);
  22. HRESULT HandleGraphEvent(void);
  23.  
  24. void Msg(TCHAR *szFormat, ...);
  25. void CloseInterfaces(void);
  26. void ResizeVideoWindow(void);
  27.  
  28. // Remote graph viewing functions
  29. HRESULT AddGraphToRot(IUnknown *pUnkGraph, DWORD *pdwRegister);
  30. void RemoveGraphFromRot(DWORD pdwRegister);
  31.  
  32. enum PLAYSTATE {Stopped, Paused, Running, Init};
  33.  
  34. //
  35. // Macros
  36. //
  37. #define SAFE_RELEASE(x) { if (x) x->Release(); x = NULL; }
  38.  
  39. #define JIF(x) if (FAILED(hr=(x))) \
  40.     {Msg(TEXT("FAILED(hr=0x%x) in ") TEXT(#x) TEXT("\n"), hr); return hr;}
  41.  
  42. //
  43. // Constants
  44. //
  45. #define DEFAULT_VIDEO_WIDTH     320
  46. #define DEFAULT_VIDEO_HEIGHT    320
  47.  
  48. #define APPLICATIONNAME TEXT("Video Capture Previewer")
  49. #define CLASSNAME       TEXT("VidCapPreviewer")
  50.  
  51. // Application-defined message to notify app of filtergraph events
  52. #define WM_GRAPHNOTIFY  WM_APP+1
  53.  
  54. //
  55. // Resource constants
  56. //
  57. #define IDI_VIDPREVIEW          100
  58.